package cate.game.role.bag.inscription;

import cate.game.role.Role;
import cp.solution.util.collection.MapKit;
import easy.java.dev.note.NoteField;

import java.util.HashMap;
import java.util.Map;

public class InscriptionPageVO {

	@NoteField("铭文格子")
	public Map<Byte, Inscription> inscriptionMap = new HashMap<>();


	public static InscriptionPageVO build(Role role,InscriptionPage page){
		InscriptionPageVO vo = new InscriptionPageVO();
		for (Map.Entry<Byte, String> entry : page.uidMap.entrySet()) {
			Inscription inscription = role.getBag().inscription.getItem(entry.getValue());
			if (inscription != null) {
				vo.inscriptionMap.put(entry.getKey(), inscription);
			}
		}
		return vo;
	}

	public InscriptionPageVO copy() {
		InscriptionPageVO cp = new InscriptionPageVO();
		cp.inscriptionMap = MapKit.cloneDeep(this.inscriptionMap);
		return cp;
	}
}
